package com.bjsxt.factory.abstractFactory;

public class Client {

    public static void main(String[] args) {
        //高端车
        CarFactory factory = new LuxuryCarFactory();
        Engine e = factory.createEngine();
        e.run();
        e.start();
        Seat s = factory.createSeat();
        s.massage();
        Tyre tyre = factory.createTyre();
        tyre.revolve();


        //中端车
        factory = new MediumCarFactory();
        Engine engine1 = factory.createEngine();
        engine1.run();
        engine1.start();
        Seat seat1 = factory.createSeat();
        seat1.massage();
        Tyre tyre1=factory.createTyre();
        //轮胎你可以自定义
        //实例化接口or 抽象类对象, 得实现接口or抽象类的方法, 你调用奇奇怪怪的JavaAPI的时候就会出现这个玩意
	/*	 Tyre tyre1=new Tyre() {
             @Override
             public void revolve() {
                 System.out.println("磨损得慢");
             }
         };*/

	/*	 new InputStream() {
             @Override
             public int read() throws IOException {
                 return 0;
             }
         };*/

    }
}
